﻿namespace Missbot.Common
{
    /// <summary>
    /// 配置管理器
    /// </summary>
    /// <typeparam name="ConfigType"></typeparam>
    public class Configger<ConfigType>
    {
        /// <summary>
        /// 配置实体
        /// </summary>
        public static ConfigType AIConfig { get; } = CommonUtil.ReadJsonData<ConfigType>("AIConfigData");
    }

    /// <summary>
    /// 默认配置实体
    /// </summary>
    public class AIConfigBase
    {
        /// <summary>
        /// 实例配置
        /// </summary>
        public InstanceConfig Instance { get; set; }

        /// <summary>
        /// Mongodb配置
        /// </summary>
        public MongoConfig Mongo { get; set; }
        
        /// <summary>
        /// Redis配置
        /// </summary>
        public RedisConfig Redis { get; set; }

        /// <summary>
        /// 钉钉机器人回调钩子
        /// </summary>
        public string DingTalkHook { get; set; }
        
        /// <summary>
        /// 宠物相关的配置
        /// </summary>
        public PetConfig Pet { get; set; }

        /// <summary>
        /// 东方卡牌配置
        /// </summary>
        public TouhouCardConfig TouhouCard { get; set; }
    }

    /// <summary>
    /// 宠物相关的配置
    /// </summary>
    public class PetConfig
    {
        /// <summary>
        /// 默认宠物图像
        /// </summary>
        public string DefaultPetAvatar { get; set; }
        
        /// <summary>
        /// 宠物存储文件夹ID
        /// </summary>
        public string PetAvatarStoreFolderID { get; set; }
    }

    /// <summary>
    /// 实例配置
    /// </summary>
    public class InstanceConfig
    {
        /// <summary>
        /// 开发者ID
        /// </summary>
        public string DeveloperID { get; set; }
        
        /// <summary>
        /// 机器人的用户名
        /// </summary>
        public string BotUserName { get; set; }
        
        /// <summary>
        /// 访问秘钥
        /// </summary>
        public string I { get; set; }
        
        /// <summary>
        /// 本地实例域名
        /// </summary>
        public string LocalHost { get; set; }
        
        /// <summary>
        /// 是否启用AI模块
        /// </summary>
        public bool EnableModule { get; set; }
        
        /// <summary>
        /// 是否启用定时器
        /// </summary>
        public bool EnableSchedule { get; set; }
        
        /// <summary>
        /// 是否启用WS侦听
        /// </summary>
        public bool EnableListening { get; set; }
    }

    /// <summary>
    /// Mongodb配置
    /// </summary>
    public class MongoConfig
    {
        /// <summary>
        /// 连接字符串
        /// </summary>
        public string MongoConnStr { get; set; }

        /// <summary>
        /// 数据库名
        /// </summary>
        public string MongoDbName { get; set; }
    }

    /// <summary>
    /// Redis配置
    /// </summary>
    public class RedisConfig
    {
        /// <summary>
        /// 域名
        /// </summary>
        public string RedisHost { get; set; }
        
        /// <summary>
        /// 端口
        /// </summary>
        public int RedisPort { get; set; }
        
        /// <summary>
        /// 密码
        /// </summary>
        public string RedisPwd { get; set; }
    }

    /// <summary>
    /// 东方卡牌配置
    /// </summary>
    public class TouhouCardConfig
    {
        /// <summary>
        /// 东方卡牌所在文件夹ID
        /// </summary>
        public string FolderID { get; set; }
    }
}